function confirmBooking()
{
	var assign = confirm("Click ok to confirm booking.");
	if(assign)
	{
		insertBooking();
	}
}

xmlhttp_booking = null;
function insertBooking()
{
xmlhttp_booking=GetXmlHttpObject();
if (xmlhttp_booking==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var source = document.getElementById('txt_source').value;
var booking_num = document.getElementById('txt_booking_num').value;
var container_type = document.getElementById('txt_container_type').value;

var container_size = document.getElementById('txt_container_size').value;
var truck_type = document.getElementById('txt_truck_type').value;
var customer = document.getElementById('txt_customer').value;

var contact_person = document.getElementById('txt_contact_person').value;
var contact_num = document.getElementById('txt_contact_num').value;
var customer_address = document.getElementById('txt_customer_address').value;

var del_date = document.getElementById('txt_del_date').value;
var del_hour = document.getElementById('txt_del_time').value;
var del_min = document.getElementById('txt_del_time').value;

var pass_data = "";
var pass_data = pass_data +"source="+ source;
var pass_data = pass_data +"&booking_num="+ booking_num;
var pass_data = pass_data +"&container_type="+ container_type;
var pass_data = pass_data +"&container_size="+ container_size;
var pass_data = pass_data +"&truck_type="+ truck_type;
var pass_data = pass_data +"&customer="+ customer;
var pass_data = pass_data +"&contact_person="+ contact_person;
var pass_data = pass_data +"&contact_num="+ contact_num;
var pass_data = pass_data +"&customer_address="+ customer_address;
var pass_data = pass_data +"&del_date="+ del_date;
var pass_data = pass_data +"&del_hour="+ del_hour;
var pass_data = pass_data +"&del_min="+ del_min;

xmlhttp_booking.onreadystatechange=function (){
if (xmlhttp_booking.readyState==4)
  {
	if(xmlhttp_booking.responseText=="1")
	{
		redirectFrame("bodyFrame","booking_list.php");
		alert("Successfully submitted booking details!");
		closePopDiv();
	}
  }
};
xmlhttp_booking.open("POST","ajax_insert_booking.php",true);
xmlhttp_booking.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp_booking.send(pass_data);
}